package com.wandousoushu.jiusen.booksource.bean;

import android.text.TextUtils;

import java.util.ArrayList;
import java.util.Objects;

import static android.text.TextUtils.isEmpty;

/**
 * 书源信息
 */
public class BookSourceBean
{

    private String bookSourceUrl;//源网址URL
    private String bookSourceName;//源网址名称
    private String loginUrl;//登录URL

    //发现规则
    private String ruleFindUrl;
    private String ruleFindNoteUrl;

    //搜索规则
    private String ruleSearchUrl;
    private String ruleSearchNoteUrl;

    //详情页规则
    private String ruleBookUrlPattern;
    private String ruleBookInfoInit;

    //目录页规则
    private String ruleChapterUrl;
    private String ruleChapterUrlNext;

    //正文页规则
    private String ruleContentUrl;
    private String ruleContentUrlNext;

    private String httpUserAgent;


    private transient ArrayList<String> groupList;

    public BookSourceBean(String bookSourceUrl, String bookSourceName, String loginUrl, String ruleFindUrl, String ruleFindNoteUrl, String ruleSearchUrl, String ruleSearchNoteUrl, String ruleBookUrlPattern, String ruleBookInfoInit, String ruleChapterUrl, String ruleChapterUrlNext, String ruleContentUrl, String ruleContentUrlNext) {
        this.bookSourceUrl = bookSourceUrl;
        this.bookSourceName = bookSourceName;
        this.loginUrl = loginUrl;
        this.ruleFindUrl = ruleFindUrl;
        this.ruleFindNoteUrl = ruleFindNoteUrl;
        this.ruleSearchUrl = ruleSearchUrl;
        this.ruleSearchNoteUrl = ruleSearchNoteUrl;
        this.ruleBookUrlPattern = ruleBookUrlPattern;
        this.ruleBookInfoInit = ruleBookInfoInit;
        this.ruleChapterUrl = ruleChapterUrl;
        this.ruleChapterUrlNext = ruleChapterUrlNext;
        this.ruleContentUrl = ruleContentUrl;
        this.ruleContentUrlNext = ruleContentUrlNext;
    }

    public BookSourceBean()
    {
    }

    private Boolean stringEquals(String str1, String str2)
    {
        return Objects.equals(str1, str2) || (isEmpty(str1) && isEmpty(str2));
    }

    public String getBookSourceName()
    {
        return bookSourceName;
    }

    public void setBookSourceName(String bookSourceName)
    {
        this.bookSourceName = bookSourceName;
    }

    public String getBookSourceUrl()
    {
        return bookSourceUrl;
    }

    public void setBookSourceUrl(String bookSourceUrl)
    {
        this.bookSourceUrl = bookSourceUrl;
    }

    public String getRuleChapterUrl()
    {
        return this.ruleChapterUrl;
    }

    public void setRuleChapterUrl(String ruleChapterUrl)
    {
        this.ruleChapterUrl = ruleChapterUrl;
    }

    public String getRuleSearchUrl()
    {
        return this.ruleSearchUrl;
    }

    public void setRuleSearchUrl(String ruleSearchUrl)
    {
        this.ruleSearchUrl = ruleSearchUrl;
    }

    public String getRuleContentUrl()
    {
        return this.ruleContentUrl;
    }

    public void setRuleContentUrl(String ruleContentUrl)
    {
        this.ruleContentUrl = ruleContentUrl;
    }

    public String getRuleSearchNoteUrl()
    {
        return this.ruleSearchNoteUrl;
    }

    public void setRuleSearchNoteUrl(String ruleSearchNoteUrl)
    {
        this.ruleSearchNoteUrl = ruleSearchNoteUrl;
    }

    public String getHttpUserAgent()
    {
        return this.httpUserAgent;
    }

    public void setHttpUserAgent(String httpHeaders)
    {
        this.httpUserAgent = httpHeaders;
    }

    public String getRuleFindUrl()
    {
        return this.ruleFindUrl;
    }

    public void setRuleFindUrl(String ruleFindUrl)
    {
        this.ruleFindUrl = ruleFindUrl;
    }

    public String getRuleChapterUrlNext()
    {
        return this.ruleChapterUrlNext;
    }

    public void setRuleChapterUrlNext(String ruleChapterUrlNext)
    {
        this.ruleChapterUrlNext = ruleChapterUrlNext;
    }

    public String getRuleContentUrlNext()
    {
        return this.ruleContentUrlNext;
    }

    public void setRuleContentUrlNext(String ruleContentUrlNext)
    {
        this.ruleContentUrlNext = ruleContentUrlNext;
    }

    public String getRuleBookUrlPattern()
    {
        return ruleBookUrlPattern;
    }

    public void setRuleBookUrlPattern(String ruleBookUrlPattern)
    {
        this.ruleBookUrlPattern = ruleBookUrlPattern;
    }

    public String getLoginUrl()
    {
        return this.loginUrl;
    }

    public void setLoginUrl(String loginUrl)
    {
        this.loginUrl = loginUrl;
    }

    public String getRuleFindNoteUrl()
    {
        return this.ruleFindNoteUrl;
    }

    public void setRuleFindNoteUrl(String ruleFindNoteUrl)
    {
        this.ruleFindNoteUrl = ruleFindNoteUrl;
    }

    public String getRuleBookInfoInit()
    {
        return this.ruleBookInfoInit;
    }

    public void setRuleBookInfoInit(String ruleBookInfoInit)
    {
        this.ruleBookInfoInit = ruleBookInfoInit;
    }

}
